function submitAction(id){
	
	var userId = document.getElementById("userId");
	var passwiord = document.getElementById("password");
	document.Form1.action="userLoginAction.do";
	var method123 = document.getElementById("method123");
	if(null != method123){
		method123.value =id;
	}
	
	var mainmethod123 = document.getElementById("mainmethod123");
	if(null !=mainmethod123 ){
		mainmethod123.value = "mainPageLogin";
	}
	var admin = document.getElementById("admin");
	var user = document.getElementById("user");
	if(null != admin && admin.checked)
		document.getElementById("admin").value = 'A';
	if(null != user && user.checked)
		document.getElementById("user").value = 'U';
	
	if(null != userId && null != passwiord){
		userId = userId.value;
		passwiord = passwiord.value;
		if("" == userId ){
			alert("Please enter User Name.");
		}else if("" == passwiord){
			alert("Please enter Pass word.");
		}else if( (null != admin && !admin.checked ) && (null != user && !user.checked )){
			alert('Please select your role(user/admin).');
			
		}else{
			document.Form1.submit();
		}
	}
	
}

function showAdminAction(id){
	document.Form1.action="userLoginAction.do";
	var method123 = document.getElementById("method123");
	if(null != method123){
		method123.value =id;
	}
	
	var mainmethod123 = document.getElementById("mainmethod123");
	if(null !=mainmethod123 ){
		mainmethod123.value = "mainPageLogin";
	}
	document.Form1.submit();
}
/*function logoutAction(id){
	document.Form1.action="userLoginAction.do";
	document.getElementById("method123").value =id;
    document.Form1.submit();
	
}*/

function SubmitFunction(id){
	
	document.formContact.action="contactUsAction.do";
    document.formContact.submit();
	
}

function ShowBodyAppfor3(id){
	var UserIDForservice = document.getElementById("UserIDForservice");
	document.getElementById("contright").innerHTML="<div style='padding-left:20px;padding-bottom:0px;' align='center' id='loadingwait' class='d1'><img alt='Plz wait...' src='images/loading48.gif' width='600' height='80'/></div>";
	if (window.XMLHttpRequest)
	  {
		// code for IE7+, Firefox, Chrome, Opera, Safari
	   xmlhttp=new XMLHttpRequest();
	  }
	else
	  {
		// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.open("POST","UIFormLeftMenuAction.do?a="+id+"&UserIDForservice="+UserIDForservice.value,true); 
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
	     { 
		  if("" == xmlhttp.responseText){
	    		
	    		document.getElementById("tool1123").style.display="";
	    		document.getElementById("contright").style.display="none";
	    		
		  }else{
			  document.getElementById("contright").style.display="";
			  document.getElementById("contright").innerHTML=xmlhttp.responseText;
			  document.getElementById("tool1123").style.display="none";
			 //	document.getElementById("contright").innerHTML=xmlhttp.responseText;  
		  }
	    
	    }
	  }

	xmlhttp.send();


}
function ShowBodyApp(id){
	var UserIDForservice = document.getElementById("UserIDForservice");
	document.getElementById("contright").innerHTML="<div style='padding-left:20px;padding-bottom:0px;' align='center' id='loadingwait' class='d1'><img alt='Plz wait...' src='images/loading48.gif' width='600' height='80'/></div>";
	if (window.XMLHttpRequest)
	  {
		// code for IE7+, Firefox, Chrome, Opera, Safari
	   xmlhttp=new XMLHttpRequest();
	  }
	else
	  {
		// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.open("POST","UIFormAction.do?a="+id+"&UserIDForservice="+UserIDForservice.value,true); 
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
	     { 
		  if("" == xmlhttp.responseText){
	    		
	    		document.getElementById("tool1123").style.display="";
	    		document.getElementById("contright").style.display="none";
	    		
		  }else{
			  document.getElementById("contright").style.display="";
			  document.getElementById("contright").innerHTML=xmlhttp.responseText;
			  document.getElementById("tool1123").style.display="none";
			 //	document.getElementById("contright").innerHTML=xmlhttp.responseText;  
		  }
	    
	    }
	  }

	xmlhttp.send();


}
function ShowbodyWithoutUser(id){
	var UserIDForservice = document.getElementById("UserIDForservice");
	
	if (window.XMLHttpRequest)
	  {
		// code for IE7+, Firefox, Chrome, Opera, Safari
	   xmlhttp=new XMLHttpRequest();
	  }
	else
	  {
		// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.open("POST","UIFormAction.do?a="+id+"&UserIDForservice="+UserIDForservice.value,true); 
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
	     { 
		  if("" == xmlhttp.responseText){
	    		
	    	//	document.getElementById("tool1123").style.display="";
	    		document.getElementById("contright").style.display="none";
	    		
		  }else{
			  document.getElementById("contright").style.display="";
			  document.getElementById("contright").innerHTML=xmlhttp.responseText;
			  document.getElementById("tool1123").style.display="none";
			 //	document.getElementById("contright").innerHTML=xmlhttp.responseText;  
		  }
	    
	    }
	  }

	xmlhttp.send();
}

function AddUserInformation(name){
	if(null != document.Form1.METHOD1234)
	document.getElementById('Register').value='Submiting Plz Wait...';
	document.Form1.METHOD1234.value = "AddUser";
	document.Form1.action="userLoginAction.do";
    document.Form1.submit();
  alert('Thank you for registering with www.investmentgateways.com. Please login with your userid & password to get access, and click "ok" to register successfully...');

}

function showServiceSubmit(id){
	
	document.Form1.action="UIFormServiceAction.do";
	document.Form1.serviceIdForservice.value =id;
	document.Form1.methodName.value = "showService";
	//alert(document.Form1.serviceIdForservice.value);
    document.Form1.submit();


}




function ShowAdminBodyApp(id){
	//document.frm.action ="/userLoginAction.do";
	document.Form1.action="userAdminShowAction.do";
	var admin = document.getElementById("admin");
	
	var methodName = document.getElementById("methodName");
	
	document.getElementById("method123").value =id;
	
	if(null != methodName){
		methodName.value = "showAdminPage";
	}
		
    document.Form1.submit();
}

function ShowToolApplication(id){
	//alert(id);
	var valueforMethod = document.getElementById("shoowMethodName");
	valueforMethod.value = "showToolPage";
	if(null != valueforMethod){
	//document.getElementById("contright").innerHTML="<table width='800' align='center' border='0' cellspacing='0' cellpadding='0' valign='middle'><tr><td>&nbsp;</td></tr><img alt='' src='/Tools/loading9.gif' width='30'/>&nbsp;&nbsp;<p valign='middle'>Plz wait...&nbsp;&nbsp;While loading...</p><tr><td>&nbsp;</td></tr></table>";
	document.getElementById("shoowMethodName").value="showToolPage";
	document.Form1.action="UIFormAction.do";
    document.Form1.submit();
	}
}

function logoutAction(id){
	
	document.Form1.action="userLoginAction.do";
	document.getElementById("method123").value =id;
	var admin = document.getElementById("admin");
	if(null != admin && admin.checked)
		document.getElementById("admin").value = 'Y';
    document.Form1.submit();
}


function showInvIndFunction(id){
	document.getElementById("showServicePage").value="showServicePage";
	window.open ("","mywindow","status=1",id);
   // document.Form1.submit();
}


function UiFrontPageFunction(id){
	//document.frm.action ="/userLoginAction.do";
	
	document.Form1.action="UiFrontPageAction.do";
	var method123 = document.getElementById("method123");
	if(null != method123){
		method123.value =id;
	}
	var admin = document.getElementById("admin");
	var user = document.getElementById("user");
	var mainmethod123 = document.getElementById("mainmethod123");
	if(null !=mainmethod123 ){
		mainmethod123.value = "mainPageLogin";
	}
		
    document.Form1.submit();
}

function ShowBodyUiApplication(id){
	 var applicationUserPage = "applicationUserPage";
       var xmlhttp;
		if (window.XMLHttpRequest)
		  {
				// code for IE7+, Firefox, Chrome, Opera, Safari
		   		xmlhttp=new XMLHttpRequest();
		  }else
		  {
				// code for IE6, IE5
		  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		xmlhttp.onreadystatechange=function()
		  {
		  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		     {
		    	document.getElementById("contright").innerHTML=xmlhttp.responseText;
		    }
		  }
	
		xmlhttp.open("POST","ShowBodyUiApplication.do?applicationUserPage="+applicationUserPage+"&id="+id,true);
	xmlhttp.send();
}


function ShowGetPostYourQuery(id){
	
	 var applicationUserPage = "adminUserPage";
      var xmlhttp;
		if (window.XMLHttpRequest)
		  {
				// code for IE7+, Firefox, Chrome, Opera, Safari
		   		xmlhttp=new XMLHttpRequest();
		  }else
		  {
				// code for IE6, IE5
		  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		xmlhttp.onreadystatechange=function()
		  {
		  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		     {
		    	document.getElementById("contright").innerHTML=xmlhttp.responseText;
		    }
		  }
		xmlhttp.open("POST","ShowGetPostYourQuery.do?applicationUserPage="+applicationUserPage+"&id="+id,true);
	xmlhttp.send();
}


function SubmitQueries(){
	
	var selectedPostQueries = null != document.getElementById("selectedPostQueries")?document.getElementById("selectedPostQueries"):"";
	var text1 = null != document.getElementById("text1")?document.getElementById("text1"):"";
	var text2 = null != document.getElementById("text2")?document.getElementById("text2"):"";
	var text3 = null != document.getElementById("text3")?document.getElementById("text3"):"";
	var text4 = null != document.getElementById("text4")?document.getElementById("text4"):"";
	var text5 = null != document.getElementById("text5")?document.getElementById("text5"):"";
	var text6 = null != document.getElementById("text6")?document.getElementById("text6"):"";
	var text7 = null != document.getElementById("text7")?document.getElementById("text7"):"";
	var text8 = null != document.getElementById("text8")?document.getElementById("text8"):"";
	var text9 = null != document.getElementById("text9")?document.getElementById("text9"):"";
	var text10 = null != document.getElementById("text10")?document.getElementById("text10"):"";
	var text11 = null != document.getElementById("text11")?document.getElementById("text11"):"";
	var text12 = null != document.getElementById("text12")?document.getElementById("text12"):"";
	var text13 = null != document.getElementById("text13")?document.getElementById("text13"):"";
	var text14 = null != document.getElementById("text14")?document.getElementById("text14"):"";
	var text15 = null != document.getElementById("text15")?document.getElementById("text15"):"";
	var text16 = null != document.getElementById("text16")?document.getElementById("text16"):"";
	var text17 = null != document.getElementById("text17")?document.getElementById("text17"):"";
	var text18 = null != document.getElementById("text18")?document.getElementById("text18"):"";
	var text19 = null != document.getElementById("text19")?document.getElementById("text19"):"";
	var text20 = null != document.getElementById("text20")?document.getElementById("text20"):"";
	var text21 = null != document.getElementById("text21")?document.getElementById("text21"):"";
	var text22 = null != document.getElementById("text22")?document.getElementById("text22"):"";
	var text23 = null != document.getElementById("text23")?document.getElementById("text23"):"";
	var text24 = null != document.getElementById("text24")?document.getElementById("text24"):"";
	var text25 = null != document.getElementById("text25")?document.getElementById("text25"):"";
	var text26 = null != document.getElementById("text26")?document.getElementById("text26"):"";
	var text27 = null != document.getElementById("text27")?document.getElementById("text27"):"";
	var text28 = null != document.getElementById("text28")?document.getElementById("text28"):"";
	var text29 = null != document.getElementById("text29")?document.getElementById("text29"):"";
	var text30 = null != document.getElementById("text30")?document.getElementById("text30"):"";
	var text31 = null != document.getElementById("text31")?document.getElementById("text31"):"";
	var text32 = null != document.getElementById("text32")?document.getElementById("text32"):"";
	var text33 = null != document.getElementById("text33")?document.getElementById("text33"):"";
	var text34 = null != document.getElementById("text34")?document.getElementById("text34"):"";
	var text35 = null != document.getElementById("text35")?document.getElementById("text35"):"";
	var text36 = null != document.getElementById("text36")?document.getElementById("text36"):"";
	var text37 = null != document.getElementById("text37")?document.getElementById("text37"):"";
	var text38 = null != document.getElementById("text38")?document.getElementById("text38"):"";
	var text39 = null != document.getElementById("text39")?document.getElementById("text39"):"";
	var text40 = null != document.getElementById("text40")?document.getElementById("text40"):"";
	var text41 = null != document.getElementById("text41")?document.getElementById("text41"):"";
	var text42 = null != document.getElementById("text42")?document.getElementById("text42"):"";
	var text43 = null != document.getElementById("text43")?document.getElementById("text43"):"";
	var text44 = null != document.getElementById("text44")?document.getElementById("text44"):"";
	var text45 = null != document.getElementById("text45")?document.getElementById("text45"):"";
	var text46 = null != document.getElementById("text46")?document.getElementById("text46"):"";
	var text47 = null != document.getElementById("text47")?document.getElementById("text47"):"";
	var text48 = null != document.getElementById("text48")?document.getElementById("text48"):"";
	var text49 = null != document.getElementById("text49")?document.getElementById("text49"):"";
	var text50 = null != document.getElementById("text50")?document.getElementById("text50"):"";
	var text51 = null != document.getElementById("text51")?document.getElementById("text51"):"";
	var text52 = null != document.getElementById("text52")?document.getElementById("text52"):"";
	var text53 = null != document.getElementById("text53")?document.getElementById("text53"):"";
	var text54 = null != document.getElementById("text54")?document.getElementById("text54"):"";
	var text55 = null != document.getElementById("text55")?document.getElementById("text55"):"";
	var text56 = null != document.getElementById("text56")?document.getElementById("text56"):"";
	var text57 = null != document.getElementById("text57")?document.getElementById("text57"):"";
	var text58 = null != document.getElementById("text58")?document.getElementById("text58"):"";
	var text59 = null != document.getElementById("text59")?document.getElementById("text59"):"";
	var text60 = null != document.getElementById("text60")?document.getElementById("text60"):"";
	var text61 = null != document.getElementById("text61")?document.getElementById("text61"):"";
	var text62 = null != document.getElementById("text62")?document.getElementById("text62"):"";
	var text63 = null != document.getElementById("text63")?document.getElementById("text63"):"";
	var text64 = null != document.getElementById("text64")?document.getElementById("text64"):"";
	var text65 = null != document.getElementById("text65")?document.getElementById("text65"):"";
	var text66 = null != document.getElementById("text66")?document.getElementById("text66"):"";
	var text67 = null != document.getElementById("text67")?document.getElementById("text67"):"";
	var text68 = null != document.getElementById("text68")?document.getElementById("text68"):"";
	var text69 = null != document.getElementById("text69")?document.getElementById("text69"):"";
	var text70 = null != document.getElementById("text70")?document.getElementById("text70"):"";
	var text71 = null != document.getElementById("text71")?document.getElementById("text71"):"";
	var text72 = null != document.getElementById("text72")?document.getElementById("text72"):"";
	var text73 = null != document.getElementById("text73")?document.getElementById("text73"):"";
	
	document.getElementById('submit123X').value='Submiting Plz Wait...';
	var xmlhttp;
		if (window.XMLHttpRequest)
		  {
				// code for IE7+, Firefox, Chrome, Opera, Safari
		   		xmlhttp=new XMLHttpRequest();
		  }else
		  {
				// code for IE6, IE5
		  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		xmlhttp.onreadystatechange=function()
		  {
		  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		     {
		    	document.getElementById("errorMessage").innerHTML=xmlhttp.responseText;
		    }
		  }
	
		var sample = "&text1="+text1.value+"&text2="+text2.value+"&text3="+text3.value+"&text3="+text3.value+"&text4="+text4.value+"&text5="+text5.value+"&text6="+text6.value+"&text7="+text7.value+"&text8="+text8.value+"&text9="+text9.value+"&text10="+text10.value+
					 "&text11="+text11.value+"&text12="+text12.value+"&text13="+text13.value+"&text14="+text14.value+"&text15="+text15.value+"&text16="+text16.value+"&text17="+text17.value+"&text18="+text18.value+"&text19="+text19.value+"&text20="+text20.value+
					"&text21="+text21.value+"&text22="+text22.value+"&text23="+text23.value+"&text24="+text24.value+"&text25="+text25.value+"&text26="+text26.value+"&text27="+text27.value+"&text28="+text28.value+"&text29="+text29.value+"&text30="+text30.value+
					"&text31="+text31.value+"&text32="+text32.value+"&text33="+text33.value+"&text34="+text34.value+"&text35="+text35.value+"&text36="+text36.value+"&text37="+text37.value+"&text38="+text38.value+"&text39="+text39.value+"&text40="+text40.value+
					"&text41="+text41.value+"&text42="+text42.value+"&text43="+text43.value+"&text44="+text44.value+"&text45="+text45.value+"&text46="+text46.value+"&text47="+text47.value+"&text48="+text48.value+"&text49="+text49.value+"&text50="+text50.value+
					"&text51="+text51.value+"&text52="+text52.value+"&text53="+text53.value+"&text54="+text54.value+"&text55="+text55.value+"&text56="+text56.value+"&text57="+text57.value+"&text58="+text58.value+"&text59="+text59.value+"&text60="+text60.value+
					"&text61="+text61.value+"&text62="+text62.value+"&text63="+text63.value+"&text64="+text64.value+"&text65="+text65.value+"&text66="+text66.value+"&text67="+text67.value+"&text68="+text68.value+"&text69="+text69.value+"&text70="+text70.value+
					"&text71="+text71.value+"&text72="+text72.value+"&text73="+text73.value;

		xmlhttp.open("POST","AddPostUrQueriesAction.do?text1="+text1.value+"&selectedPostQueries="+selectedPostQueries.value+sample,true);
	xmlhttp.send();
	
}

function isExistUser(){
	var userName = null != document.getElementById("userNameforReg")?document.getElementById("userNameforReg"):"";
	var userId = null != document.getElementById("userIdforIns")?document.getElementById("userIdforIns"):"";
	var userLastName = null != document.getElementById("userLastName")?document.getElementById("userLastName"):"";
	var userType = null != document.getElementById("registor")?document.getElementById("registor"):"";
	var dob = null != document.getElementById("dob")?document.getElementById("dob"):"";
	var email = null != document.getElementById("email")?document.getElementById("email"):"";
	var tel = null != document.getElementById("tel")?document.getElementById("tel"):"";
	var userAddress = null != document.getElementById("userAddress")?document.getElementById("userAddress"):"";
	var ptc = null != document.getElementById("ptc")?document.getElementById("ptc"):"";
	document.getElementById("MsgID").style.display='none';
	var numTest=new RegExp("^[0-9]*\.?[0-9]+$");
	
	if(userId.value == ""){
		document.getElementById("MsgID").innerHTML="Please Enter User Id.";
		document.getElementById("MsgID").style.display='';
		return false;
	}else if(userName.value == ""){
		document.getElementById("MsgID").innerHTML="Please Enter User name.";
		document.getElementById("MsgID").style.display='';
		return false;
	}else if(userLastName.value == ""){
		document.getElementById("MsgID").style.display='';
		document.getElementById("MsgID").innerHTML="Please Enter user Last Name.";
		return false;
	}else if(userType.value == ""){
		document.getElementById("MsgID").style.display='';
		document.getElementById("MsgID").innerHTML="Please Enter userType.";
		return false;
	}else if(dob.value == ""){
		document.getElementById("MsgID").style.display='';
		document.getElementById("MsgID").innerHTML="Please Enter Date Of Birth.";
		return false;
	}else if(email.value == ""){
		document.getElementById("MsgID").style.display='';
		document.getElementById("MsgID").innerHTML="Please Enter Email.";
		return false;
		
	}else if(!validateEmail(email.value)){
		document.getElementById("MsgID").style.display='';
		document.getElementById("MsgID").innerHTML="Please Enter Valid Email.";
		return false;
		
		
		
	}else if(tel.value == ""){
		document.getElementById("MsgID").style.display='';
		document.getElementById("MsgID").innerHTML="Please Enter Telephone.";
		return false;
	}else if(!numTest.test(tel.value)){
		document.getElementById("MsgID").style.display='';
		document.getElementById("MsgID").innerHTML="Please Enter Numeric Values Only for Phone number";
		return false;
	}else if(userAddress.value == ""){
		document.getElementById("MsgID").style.display='';
		document.getElementById("MsgID").innerHTML="Please Enter Address.";
		return false;
	}else if(ptc.value == ""){
		document.getElementById("MsgID").style.display='';
		document.getElementById("MsgID").innerHTML="Please Enter Postal Code.";
		return false;
	}else if(!numTest.test(ptc.value) ){
		document.getElementById("MsgID").style.display='';
		document.getElementById("MsgID").innerHTML="Please Enter Numeric Values Only for Post Code";
		return false;
	}else{
	
	 var applicationUserPage = "adminUserPage";
	 document.getElementById('Register').value='Submiting Plz Wait...';
     var xmlhttp;
		if (window.XMLHttpRequest)
		  {
				// code for IE7+, Firefox, Chrome, Opera, Safari
		   		xmlhttp=new XMLHttpRequest();
		  }else
		  {
				// code for IE6, IE5
		  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		xmlhttp.onreadystatechange=function()
		  {
		  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		     {
		    	document.getElementById("ResponseText").innerHTML="<font color='green'>"+xmlhttp.responseText+"</font>";
		    }
		  }
	xmlhttp.open("POST","isUserExistAction.do?METHOD1234=AddUser&username="+userName.value+"&userIdforIns="+userId.value+"&userLastName="+userLastName.value+"&registor="+userType.value+"&dob="+dob.value+"&email="+email.value+"&tel="+tel.value+"&userAddress="+userAddress.value+"&ptc="+ptc.value,true);
	xmlhttp.send();
	//document.getElementById('Register').value='Submit';
	}

		
	
}

$(document).ready(function(){
$("#userIdforIns").keyup(function(e){
	if(e.which == "32")
		{
		$("#userIdforIns").val("");
		}
	});	
})
function UpdateUserInfo(id){
	var userName = null != document.getElementById("userNameforReg")?document.getElementById("userNameforReg"):"";
	var userId = null != document.getElementById("userIdforIns")?document.getElementById("userIdforIns"):"";
	var passWord = null != document.getElementById("pwd")?document.getElementById("pwd"):"";
	var userType = null != document.getElementById("registor")?document.getElementById("registor"):"";
	var dob = null != document.getElementById("dob")?document.getElementById("dob"):"";
	var email = null != document.getElementById("email")?document.getElementById("email"):"";
	var tel = null != document.getElementById("tel")?document.getElementById("tel"):"";
	var userAddress = null != document.getElementById("userAddress")?document.getElementById("userAddress"):"";
	var ptc = null != document.getElementById("ptc")?document.getElementById("ptc"):"";
	
	var numTest=new RegExp("^[0-9]*\.?[0-9]+$");
	
	if(userId.value == ""){
		document.getElementById("MsgID").innerHTML="Please Enter User Id.";
		return false;
	}else if(userName.value == ""){
		document.getElementById("MsgID").innerHTML="Please Enter User name.";
		return false;
	}else if(passWord.value == ""){
		document.getElementById("MsgID").innerHTML="Please Enter PassWord.";
		return false;
	}else if(userType.value == ""){
		document.getElementById("MsgID").innerHTML="Please Enter userType.";
		return false;
	}else if(dob.value == ""){
		document.getElementById("MsgID").innerHTML="Please Enter Date Of Birth.";
		return false;
	}else if(email.value == ""){
		document.getElementById("MsgID").innerHTML="Please Enter Email.";
		return false;
	}else if(!validateEmail(email.value)){
		document.getElementById("MsgID").innerHTML="Please Enter Valid Email.";
		return false;
	}else if(tel.value == ""){
		document.getElementById("MsgID").innerHTML="Please Enter Telephone.";
		return false;
	}else if(!numTest.test(tel.value)){
		document.getElementById("MsgID").innerHTML="Please Enter Numeric Values Only for Phone number";
		return false;
	}else if(userAddress.value == ""){
		document.getElementById("MsgID").innerHTML="Please Enter Address.";
		return false;
	}else if(ptc.value == ""){
		document.getElementById("MsgID").innerHTML="Please Enter Postal Code.";
		return false;
	}else if(!numTest.test(ptc.value) ){
		document.getElementById("MsgID").innerHTML="Please Enter Numeric Values Only for Post Code";
		return false;
	}else{
	 var applicationUserPage = "adminUserPage";
	 document.getElementById('Register').value='Submiting Plz Wait...';
     var xmlhttp;
		if (window.XMLHttpRequest)
		  {
				// code for IE7+, Firefox, Chrome, Opera, Safari
		   		xmlhttp=new XMLHttpRequest();
		  }else
		  {
				// code for IE6, IE5
		  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		xmlhttp.onreadystatechange=function()
		  {
		  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		     {
		    	document.getElementById("MsgID").innerHTML="<font color='red'>"+xmlhttp.responseText+"</font>";
		    }
		  }
	//xmlhttp.open("POST","isUserExistAction.do?METHOD1234=AddUser&username="+userName.value+"&userIdforIns="+userId.value+"&pwd="+passWord.value+"&registor="+userType.value+"&dob="+dob.value+"&email="+email.value+"&tel="+tel.value+"&userAddress="+userAddress.value+"&ptc="+ptc.value,true);
	//xmlhttp.send();
	document.getElementById('Register').value='Submit';
	}
}
function RetrivePasswordAction(){
	var userName = null != document.getElementById("userNameforReg")?document.getElementById("userNameforReg"):"";
	var userId = null != document.getElementById("userIdforIns")?document.getElementById("userIdforIns"):"";
	var passWord = null != document.getElementById("pwd")?document.getElementById("pwd"):"";
	var ReEnterPassWord = null != document.getElementById("pwd")?document.getElementById("pwd"):"";
	var userType = null != document.getElementById("registor")?document.getElementById("registor"):"";
	var email = null != document.getElementById("email")?document.getElementById("email"):"";
	var tel = null != document.getElementById("tel")?document.getElementById("tel"):"";
	
	var numTest=new RegExp("^[0-9]*\.?[0-9]+$");
	
	if(userId.value == ""){
		document.getElementById("MsgID").innerHTML="Please Enter User Id.";
		return false;
	}else{
	 var applicationUserPage = "adminUserPage";
	 document.getElementById('Register').value='Submiting Plz Wait...';
     var xmlhttp;
		if (window.XMLHttpRequest)
		  {
				// code for IE7+, Firefox, Chrome, Opera, Safari
		   		xmlhttp=new XMLHttpRequest();
		  }else
		  {
				// code for IE6, IE5
		  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		xmlhttp.onreadystatechange=function()
		  {
		  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		     {
		    	document.getElementById("MsgID").innerHTML="<font color='red'>"+xmlhttp.responseText+"</font>";
		    }
		  }
	xmlhttp.open("POST","isUserExistAction.do?METHOD1234=forgotPassword&username="+userName.value+"&userIdforIns="+userId.value+"&pwd="+passWord.value+"&registor="+userType.value+"&email="+email.value+"&tel="+tel.value,true);
	xmlhttp.send();
	document.getElementById('Register').value='Submit';
	}
}
function ChangePasswordAction(actionMess){
	
	var userName = null != document.getElementById("userNameforReg")?document.getElementById("userNameforReg"):"";
	var userId = null != document.getElementById("userIdforIns")?document.getElementById("userIdforIns"):"";
	var newpassWord = null != document.getElementById("newpwd")?document.getElementById("newpwd"):"";
	var ReEnterPassWord = null != document.getElementById("reEnterpwd")?document.getElementById("reEnterpwd"):"";
	var email = null != document.getElementById("email")?document.getElementById("email"):"";
	var tel = null != document.getElementById("tel")?document.getElementById("tel"):"";
	var userType = null != document.getElementById("registor")?document.getElementById("registor"):"";
	var numTest=new RegExp("^[0-9]*\.?[0-9]+$");
	if(userId.value == ""){
		document.getElementById("MsgID").innerHTML="Please Enter User Id.";
		return false;
	}else if(newpassWord.value == ""){
		document.getElementById("MsgID").innerHTML="Please Enter PassWord.";
		return false;
	}else if(ReEnterPassWord.value == ""){
		document.getElementById("MsgID").innerHTML="Please Re-Enter PassWord.";
		return false;
	}else if(ReEnterPassWord.value != newpassWord.value){
		document.getElementById("MsgID").innerHTML="Entered passWord and re enter password did not match.";
		return false;
	}else if(ReEnterPassWord.value.length <= "6"){
		document.getElementById("MsgID").innerHTML="Please Enter password atleast 6 Characters.";
		return false;
	}else if(ReEnterPassWord.value.length >= "10"){
		document.getElementById("MsgID").innerHTML="Please Enter password exeeds  10 Characters.";
		return false;
	}else if(email.value == ""){
		document.getElementById("MsgID").innerHTML="Please Enter Email.";
		return false;
	}else if(!validateEmail(email.value)){
		document.getElementById("MsgID").innerHTML="Please Enter Valid Email.";
		return false;

	}else if(tel.value == ""){
		document.getElementById("MsgID").innerHTML="Please Enter mobile number.";
		return false;
	}else if(!numTest.test(tel.value) ){
		document.getElementById("MsgID").innerHTML="Please Enter Numeric Values Only for Post Code";
		return false;
	}else{
		document.getElementById("MsgID").innerHTML=""; 
	 var applicationUserPage = "adminUserPage";
	 document.getElementById('Register').value='Submiting Plz Wait...';
     var xmlhttp;
		if (window.XMLHttpRequest)
		  {
				// code for IE7+, Firefox, Chrome, Opera, Safari
		   		xmlhttp=new XMLHttpRequest();
		  }else
		  {
				// code for IE6, IE5
		  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		xmlhttp.onreadystatechange=function()
		  {
		  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		     {
		    	document.getElementById("MsgID").innerHTML="<font color='red'>"+xmlhttp.responseText+"</font>";
		    }
		  }
	xmlhttp.open("POST","isUserExistAction.do?METHOD1234=changePassword&userIdforIns="+userId.value+"&pwd="+ReEnterPassWord.value+"&registor="+userType.value+"&email="+email.value+"&tel="+tel.value,true);
	
	xmlhttp.send();
	document.getElementById('Register').value='Submit';
	}
}
function updatePassword(id){

var userId = null != document.getElementById("userIdforIns")?document.getElementById("userIdforIns"):"";
var passWord = null != document.getElementById("pwd")?document.getElementById("pwd"):"";
var ReEnterPassWord = null != document.getElementById("pwd")?document.getElementById("pwd"):"";
var isUserAccess = null != document.getElementById("isUserAccess")?document.getElementById("isUserAccess"):"";
var isAdminAccess = null != document.getElementById("isAdminAccess1")?document.getElementById("isAdminAccess1"):"";


if(userId.value == ""){
	document.getElementById("MsgID").innerHTML="Please Enter User Id.";
	return false;
}else if(passWord.value == ""){
	document.getElementById("MsgID").innerHTML="Please Enter PassWord.";
	return false;
}else{

 var applicationUserPage = "adminUserPage";
 document.getElementById('Register').value='Submiting Plz Wait...';
 var xmlhttp;
	if (window.XMLHttpRequest)
	  {
			// code for IE7+, Firefox, Chrome, Opera, Safari
	   		xmlhttp=new XMLHttpRequest();
	  }else
	  {
			// code for IE6, IE5
	  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
	     {
	    	document.getElementById("MsgID").innerHTML="<font color='red'>"+xmlhttp.responseText+"</font>";
	    }
	  }
xmlhttp.open("POST","isUserExistAction.do?METHOD1234=UpdatePassword&userIdforIns="+userId.value+"&pwd="+passWord.value+"&isUserAccess="+isUserAccess.value+"&isAdminAccess="+isAdminAccess.value,true);
xmlhttp.send();
document.getElementById('Register').value='Submit';
}
}


function validateEmail(email)
{
var reg = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
if (reg.test(email)){
		return true; 
	}else{
		return false;
	}
}
function Disable_Control_C() {
	var keystroke = String.fromCharCode(event.keyCode).toLowerCase();
	if (event.ctrlKey && (keystroke == 'c' || keystroke == 'a')) {
	alert("This function is not allowed here.");
	event.returnValue = false; // disable Ctrl+C
	}
	}
function UserLoginAction(){
	$.blockUI();
	document.Form1.action="userLoginAction.do";
	//document.getElementById("method123").value =id;
	//var admin = document.getElementById("admin");
	//if(null != admin && admin.checked)
	//	document.getElementById("admin").value = 'Y';
    document.Form1.submit();
}

$(document).ready(function(){
    // show popup when you click on the link
    $('.show-popup').click(function(event){
        event.preventDefault(); // disable normal link function so that it doesn't refresh the page
        var docHeight = $(document).height(); //grab the height of the page
        var scrollTop = $(window).scrollTop(); //grab the px value from the top of the page to where you're scrolling      
        $('.overlay-bg').show().css({'height' : docHeight}); //display your popup and set height to the page height
        $('.overlay-content').css({'top': scrollTop+200+'px'}); //set the content 20px from the window top  
    });
    // hide registration when user clicks on Login
    $('.show-popup').click(function(){
        $('#login').show(); // hide the overlay
    });
    // hide popup when user clicks on close button
    $('.close-btn').click(function(){
        $('.overlay-bg').hide(); // hide the overlay
    });
    // hide registration when user clicks on Login
    $('.show-popup').click(function(){
        $('#registration').hide(); // hide the overlay
    });
    // hides the popup if user clicks anywhere outside the container
    $('.overlay-bg').click(function(){
        $('.overlay-bg').hide();
    })
    // prevents the overlay from closing if user clicks inside the popup overlay
    $('.overlay-content').click(function(){
        return false;
    });
 
});
$(document).ready(function(){
    // show popup when you click on the link
    $('.show-popup1').click(function(event){
        event.preventDefault(); // disable normal link function so that it doesn't refresh the page
        var docHeight = $(document).height(); //grab the height of the page
        var scrollTop = $(window).scrollTop(); //grab the px value from the top of the page to where you're scrolling      
        $('.overlay-bg').show().css({'height' : docHeight}); //display your popup and set height to the page height
        $('.overlay-content').css({'top': scrollTop+200+'px'}); //set the content 20px from the window top  
    });
    // hide registration when user clicks on Login
    $('.show-popup1').click(function(){
        $('#registration').show(); // hide the overlay
    });
    // hide popup when user clicks on close button
    $('.close-btn').click(function(){
        $('.overlay-bg').hide(); // hide the overlay
    });
    // hide registration when user clicks on Login
    $('.show-popup1').click(function(){
        $('#login').hide(); // hide the overlay
    });
    // hides the popup if user clicks anywhere outside the container
    $('.overlay-bg').click(function(){
        $('.overlay-bg').hide();
    })
    // prevents the overlay from closing if user clicks inside the popup overlay
    $('.overlay-content').click(function(){
        return false;
    });
 
});

/* Tools content Navigation Script
*/
   function more()
    {
    	var i=$('#more_val').val();
    	var j = parseInt(i)+1;
    	if(i==2)
   		{
    		$('#cont_2').css('display','none');
        	$('#cont_1').css('display','block');
        	$('#more_val').val('1');
        	document.getElementById('2ndNav').style.display="";
   		}
    	else
   		{
    		$('#cont_'+j).css('display','block');
        	$('#cont_'+i).css('display','none');
        	$('#more_val').val(j);
        	document.getElementById('2ndNav').style.display="none";
   		}
    	
    }
    function moreid()
    {
    	var i=$('#moreid_val').val();
    	var j = parseInt(i)+1;
    	if(i==2)
   		{
    		$('#conta_2').css('display','none');
        	$('#conta_1').css('display','block');
        	$('#moreid_val').val('1');
        	document.getElementById('4thNav').style.display="";
   		}
    	else
   		{
    		$('#conta_'+j).css('display','block');
        	$('#conta_'+i).css('display','none');
        	$('#moreid_val').val(j);
        	document.getElementById('4thNav').style.display="none";
   		}
    	
    }
    function moreInd()
    {
    	var i=$('#moreInd_val').val();
    	var j = parseInt(i)+1;
    	if(i==2)
   		{
    		$('#contInd_2').css('display','none');
        	$('#contInd_1').css('display','block');
        	$('#moreInd_val').val('1');
        	document.getElementById('4thNav').style.display="";
   		}
    	else
   		{
    		$('#contInd_'+j).css('display','block');
        	$('#contInd_'+i).css('display','none');
        	$('#moreInd_val').val(j);
        	document.getElementById('4thNav').style.display="none";
   		}
    	
    }
    
    
